#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStack>
#include "filter.h"

class QAction;
class QMenu;
class QLabel;
class QSpinBox;
class QProgressBar;
class QPushButton;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow();

private slots:
    void open();
    bool save();
    bool saveAs();
    void undo();
    void redo();
    void about();
    void meanFilter();
    void medianFilter();

private:
    void createActions();
    void createMenus();
    void createToolBars();
    void createStatusBar();
    void readSettings();
    void writeSettings();
    void loadFile(const QString &fileName);
    bool saveFile(const QString &fileName);
    void setCurrentFile(const QString &fileName);
    void filter(Filter *filter);

    QLabel *imageLabel;
    QString curFile;
    bool modified;
    QLabel *sizeLabel;
    QSpinBox *sizeSpinBox;
    QPushButton *filtersButton;
    QPushButton *stopButton;
    QProgressBar *progress;
    QStack<QPixmap> undoStack;
    QStack<QPixmap>::iterator undoPointer;

    QMenu *fileMenu;
    QMenu *editMenu;
    QMenu *filtersMenu;
    QMenu *helpMenu;
    QToolBar *fileToolBar;
    QToolBar *editToolBar;
    QToolBar *filtersToolBar;
    QAction *openAct;
    QAction *saveAct;
    QAction *saveAsAct;
    QAction *undoAct;
    QAction *redoAct;
    QAction *exitAct;
    QAction *meanAct;
    QAction *medianAct;
    QAction *aboutAct;
    QAction *aboutQtAct;
};

#endif
